package com.doit.day04

object _01_flatMap {
  def main(args: Array[String]): Unit = {

    val list: List[String] = List("hello,hello", "hi,hi,hi", "siyi,siyi,siyi")

    val maped: List[Array[String]] = list.map(_.split(","))

    val flatten: List[String] = maped.flatten
    println(flatten)

    //flatMap 就是上面两个算子的结合

    val res: List[String] = list.flatMap(_.split(","))
    println(res)


  }
}
